﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ManageProducts.aspx.vb" Inherits="Arwani.Backend_ManageProducts" %>

<%@ Register src="Menu.ascx" tagname="Menu" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title> Arwani Backend Panel</title>
    <style type="text/css">
        .style2
        {
            width: 135px;
        }
    </style>
    <script src="../js/jquery.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function postSortOrder(sortOrder, tableName, whereID, valueID) {
            $('#div_result').html('<input  type="image" src="../images/loading.gif" />');
            $.post("UpdateSortOrder.aspx", { sortOrder: sortOrder, tableName: tableName, whereID: whereID, valueID: valueID }, function (data) {
                $('#div_result').html(data);
            });
        }
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table border="0" cellpadding="2" cellspacing="2" width="100%" align="center">
        <tr>
            <td align="center">
                <uc1:Menu ID="Menu1" runat="server" />                 
            </td>
        </tr>
        <tr>
        <td align="right" style="padding-right:200px;">
            <asp:LinkButton ID="lnkAddNewProduct" runat="server">Add New Product</asp:LinkButton>
        </td>
        </tr>
                    <tr>
                <td align="center" style="height: 5px">
            <asp:Label ID="lblHeading" runat="server" Font-Size="XX-Large" 
                Font-Underline="True" ForeColor="Black">Products</asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <div id="div_result" style="color:Red"></div></td>
            </tr>
        <tr>
        <td align="center">
            <table border="0" align="center" cellpadding="3" cellspacing="4">
                <tr>
                    <td>
                       <asp:Label ID="lblSearchlabel" runat="server" Text="Search"></asp:Label>&nbsp;
                       </td>
                    <td>
                        <asp:TextBox ID="txtSearch" runat="server" CssClass="form-control"></asp:TextBox>
                    </td><td><asp:DropDownList ID="cboBrands" runat="server" CssClass="form-control select-tab">
                                </asp:DropDownList></td>
                    <td>
                        <asp:LinkButton ID="lnkSearch" runat="server" Text="Filter Records"></asp:LinkButton>
                    </td>
                </tr>
            </table>
        </td>
        </tr>
          <tr><td style="line-height:5px;">&nbsp;</td></tr>
        <tr>
        <td align="center">
            <asp:DataGrid ID="dgProducts" runat="server" AutoGenerateColumns="False"  DataKeyField="productid"
            AllowPaging="True" CellPadding="4" ForeColor="#333333" GridLines="None"  CssClass="table" 
                PageSize="100">
                        <AlternatingItemStyle BackColor="White" />
                        <Columns>
                        
                            <asp:BoundColumn DataField="productid" HeaderText="Product ID"></asp:BoundColumn>
                            <asp:BoundColumn DataField="prodname" HeaderText="Product Name"></asp:BoundColumn>
                            
                            <asp:TemplateColumn  Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lblProdDesc" Visible="false" runat="server" Text='<%#getDesc(DataBinder.Eval(Container.DataItem,"proddesc")) %>' >Manage Images</asp:Label>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                             
                            
                             <asp:TemplateColumn HeaderText="Brand Name">
                                <ItemTemplate>
                                    <asp:Label ID="lblBrandName"  runat="server" Text='<%#getBrandName(DataBinder.Eval(Container.DataItem,"brandid")) %>' ></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                          
                            <asp:TemplateColumn HeaderText="Sort Order">
                                <ItemTemplate>
                                    <asp:TextBox Width="45px" MaxLength="4" ID="txtSortOrder" runat="server" text='<%#DataBinder.Eval(Container.DataItem,"sortorder") %>' ></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:BoundColumn Visible="false" DataField="catid" HeaderText="Category ID"></asp:BoundColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkFeatured" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"productid") %>' CommandName='Featured'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkImageGallery" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"productid") %>' CommandName="Images">Manage Images</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"productid") %>' CommandName="Edit">Edit</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"productid") %>'  CommandName="Delete">Delete</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                        <EditItemStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle Font-Bold="True" BackColor="#507CD1" ForeColor="White" />
                        <ItemStyle BackColor="#EFF3FB" />
                        <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" BackColor="#2461BF" 
                            ForeColor="White" Mode="NumericPages" />
                        <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    </asp:DataGrid>
        </td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>